#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :playwright_test.py
# @Time      :2024/3/2 17:09
# @Author    :Sherlock
from playwright.sync_api import sync_playwright


with sync_playwright() as playwright:
    bro = playwright.chromium.launch(headless=False)
    page = bro.new_page()
    page.goto("https://www.baidu.com")
    page.locator("#kw").press_sequentially("python", delay=500)
    print(page.evaluate("window.navigator.webdriver"))

    page.close()
    bro.close()

